﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameBase;
using Microsoft.Xna.Framework.Content;
using GameLayer;
using Microsoft.Xna.Framework;

namespace MainGame.GameInstrument
{
    public class TreeFactory
    {
        private static Sprite[] Trees { get; set; }
        private static bool Initialized { get; set; }
        public TreeFactory(ContentManager content)
        {
            if (!Initialized)
            {
                int n = 32;
                Trees = new Sprite[32];
                Rectangle defineCollision = new Rectangle(40, 20, -40, -20);
                for (int i = 0; i < n; i++)
                {
                    Trees[i] = new Sprite(content, "Images/Sprites/Trees/trees_" + i, 1);
                    Trees[i].CollisionDefine = defineCollision;
                }
            }
        }
        public Sprite this[int i]
        {
            get
            {
                return Trees[i];
            }
        }
        public Sprite[] GetAll()
        {
            return Trees;
        }
    }
}
